package cn.baiweigang.uu.db.repository;

import cn.baiweigang.uu.db.dataobj.StockInfoDo;
import cn.baiweigang.uu.db.mapper.BaseInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class BaseInfoRepository {

    @Autowired
    private BaseInfoMapper baseInfoMapper;

    public void insertOrUpdateBatch(List<StockInfoDo> stockInfoDoList) {
        baseInfoMapper.insertOrUpdateBatch(stockInfoDoList);
    }

    public void insertOrUpdate(StockInfoDo stockInfoDo) {
        baseInfoMapper.insertOrUpdate(stockInfoDo);
    }

    public StockInfoDo query(String dm) {
        return baseInfoMapper.queryByDm(dm);
    }

    public List<StockInfoDo> queryCN() {
        return baseInfoMapper.queryCN();
    }

    public List<StockInfoDo> queryCN(int start,int num) {
        return baseInfoMapper.queryCNLimit(start,num);
    }
}
